#include <stdio.h>
#include "ztest.h"
#include <string.h>
#include <stdlib.h>

int main()
{
    person p;
    p.age = 12;
    strcpy(p.name, "hahazjr");
    p.height= 13;

    void * mem = calloc(1, sizeof(person));
    memcpy(mem, &p, sizeof(person));

    person * p2 = (person *)mem;
    printf("p2.age = %d\n", p2->age);
    printf("p2.height = %d\n", p2->height);
    printf("p2.name = %s\n", p2->name);

    free(mem);
    mem = NULL;
    printf("OK\n");
    getchar();
    return 0;
}
